﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="report-news-filter.aspx.cs" Inherits="MediaMonitor.Users.report_news_filter" 
Theme="default" MasterPageFile="~/user.master" Title="Report Filters - News" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="~/Controls/AutoCompleteExtender.ascx" TagPrefix="ctrl" TagName="AutoComplete" %>


<asp:Content ContentPlaceHolderID="Head" runat="server">
    <link href="../rad-scripts/Calendar.MyCustomSkin.css" rel="stylesheet" type="text/css" />
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">

            function DateSelected(sender, eventArgs) {


                var date = eventArgs.get_renderDay().get_date();
                var dfi = sender.DateTimeFormatInfo;
                var formattedDate = dfi.FormatDate(date, dfi.ShortDatePattern);

                var calE = $find("<%= calE.ClientID %>");

                calE.selectDate(date, true)

            } 

        </script>
    </telerik:RadCodeBlock>
</asp:Content>

<asp:Content ContentPlaceHolderID="Body" runat="server">

<asp:Panel ID="pnlSearch" runat="server">

<table>
    <tr>
        <td colspan="2">
            <b>Dates</b><br /><br />
        </td>
    </tr>
    <tr>
        <td></td>
        <td>
            <table>
                <tr valign="top">
                    <td>
                        From Date
                        <br />
                        <telerik:RadCalendar AutoPostBack="false" ID="calS" runat="server" EnableMultiSelect="false"
                            ClientEvents-OnDateSelected="DateSelected">
                        </telerik:RadCalendar>
                    </td>
                    <td><div style="width:50px;"></div></td>
                    <td>
                        To Date
                        <br />
                        <telerik:RadCalendar AutoPostBack="false" ID="calE" runat="server" EnableMultiSelect="false">
                        </telerik:RadCalendar>
                    </td>
                    
                </tr>
                <tr>
                    <td colspan="3">
                        <small><u class="ErrorText">Note:</u> only dates in blue color are valid dates having commercial's data.</small>
                    </td>
                </tr>
            </table>
        </td> 
    </tr>

    <tr>
        <td colspan="2"><br /><br /><b>Media</b><br /><br /></td>
    </tr>

    <tr valign="top">
        <td>Media Type</td>
        <td>
            <asp:DropDownList ID="lstMediaType"  runat="server"
                AutoPostBack="true" DataValueField="MediaTypeCode" 
                DataTextField="MediaTypeName" 
                onselectedindexchanged="lstMediaType_SelectedIndexChanged"   /><br /><br />
        </td>
    </tr>
    
    <tr valign="top">
        <td>
            Channel / Media Name
        </td>
        <td style="font-size: small;">
            <script type="text/javascript">
                function chkAllMedia_Clicked(obj) {
                    var selected = document.getElementById('<%=chkAllMedia.ClientID%>').checked;
                    if (selected)
                        document.getElementById('dvMediaList').style.display = 'none';
                    else
                        document.getElementById('dvMediaList').style.display = 'block';
                }
            </script>
            <asp:CheckBox ID="chkAllMedia" runat="server" Text="Search from all Media Channels"
                Checked="true" />
            <div id="dvMediaList" style="display: none;" class="Box">
                <asp:CheckBoxList ID="lstMedia" runat="server" DataValueField="MediaCode" DataTextField="MediaName"
                    RepeatColumns="5" RepeatDirection="Horizontal" Font-Size="8px">
                </asp:CheckBoxList>
            </div>
            <script type="text/javascript">
                document.getElementById('<%=chkAllMedia.ClientID%>').onclick = chkAllMedia_Clicked;
            </script>
             
            <br />
        </td>
    </tr>

    
    <tr>
        <td colspan="2">
            <br /><b>Products</b><br /><br />
        </td>
    </tr>




 <tr>
        <td colspan="2">
            <asp:UpdatePanel ID="pnlUpdate_prod" runat="server" >
                <ContentTemplate>
                
                
            <table>            
                <tr valign="top">
                    <td style="width: 133px;">Sector</td>
                    <td>
                    <asp:DropDownList ID="lstSector" runat="server" AutoPostBack="true" OnSelectedIndexChanged="lstSector_Changed" DataTextField="SectorName" DataValueField="SectorID" />
                </td>
            
                </tr>
                <tr>
                <td>Sub Sector</td>
                <td>
                    <asp:DropDownList ID="lstSubSector" runat="server" AutoPostBack="true" OnSelectedIndexChanged="lstSubSector_Changed"
                        DataTextField="SubSectorName" DataValueField="SubSectorID" />
                        <br />
                </td>
            </tr>
                
                <tr>
                <td>Category</td>
                <td>
                    <asp:DropDownList ID="lstCategory" runat="server"
                        DataTextField="CategoryName" DataValueField="CategoryID" />
                </td>
            </tr>
             <tr>
                    <td colspan="2">
                        <br /><br />
                    </td>
                </tr>
              <tr style="display:none;">
                    <td>
                        Advertiser
                    </td>
                    <td>
                        <asp:DropDownList ID="lstAdvertiser" runat="server"
                            DataTextField="AdvertiserName" DataValueField="AdvertiserID" />
                    </td>
                </tr> 

            </table>
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
    </tr>
        

       
        <tr>
            <td colspan="2">
                <br />
                <br />
            </td>
        </tr>
       
        
        <tr>
            <td>
                Product
            </td>
            <td>
                <ctrl:AutoComplete ID="acProduct" runat="server" MinimumPrefixLength="2"  
                    ServicePath="~/users/report-news-filter.aspx" ServiceMethod="AutoComplete_FillProduct"
                    completionsetcount="10" />
            </td>
        </tr>
    
        <tr>
            <td colspan="4">
                <br />
                <br />
                <b>Options</b><br /><br /></td>
            <td colspan="3">
                
            </td>
        </tr>
       <tr>
        <td>News Section</td>
        <td>
            <asp:DropDownList ID="lstSection" runat="server" />
        </td>
       </tr>
    <tr>
        <td>
            News Type
        </td>
        <td>
            <asp:DropDownList ID="lstNewsType" runat="server" />
        </td>
    </tr>
    <tr>
        <td>
            News Media Types
        </td>
        <td>
            <asp:DropDownList ID="lstNewsMediaType" runat="server" />
        </td>
    </tr>
        <tr>
            <td>
                Price From
            </td>
            <td colspan="3">
                <asp:TextBox ID="tbPriceFrom" runat="server" Width="80"></asp:TextBox>
                <asp:RangeValidator ID="rvPriceFrom" runat="server" 
                    ControlToValidate="tbPriceFrom" Display="Dynamic" ErrorMessage="Invalid price" 
                    MaximumValue="9999" MinimumValue="0" Text="Invalid price" Type="Currency" />
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Price To &nbsp; &nbsp;
                <asp:TextBox ID="tbPriceTo" runat="server" Width="80"></asp:TextBox>
                <asp:RangeValidator ID="rvPriceTo" runat="server" ControlToValidate="tbPriceTo" 
                    Display="Dynamic" ErrorMessage="Invalid price" MaximumValue="9999" 
                    MinimumValue="0" Text="Invalid price" Type="Currency" />
            </td>
        </tr>
    <tr >
        <td>
        </td>
         <td colspan="3">
                    <br />
                      <span style="font-size:10px;"> Download all the videos, audios, or images related to your:</span>
                    <br />
                      <asp:CheckBox ID="chkFirstAppearance" runat="server" Checked="false" Text="Show only the first appearance of commerical"  Visible="false"/>
                 <asp:CheckBox ID="chkDownload" runat="server" Checked="false" Text="category" Font-Bold="true"/>
                  &nbsp;
                  <asp:CheckBox ID="chkDownloadProduct" runat="server" Checked="false" Text="product" Font-Bold="true"/>
             <%--  &nbsp;
                   <asp:CheckBox ID="chkDownloadAdvertiser" runat="server" Checked="false" Text="advertiser" Font-Bold="true"/>--%>
                </td>
    </tr>
 
        <tr>
            <td></td>
            <td colspan="3">
                <asp:ImageButton ID="btnSearch" runat="server" OnClick="btnSearch_Click" SkinID="Search" /> 

                <asp:UpdatePanel ID="pnlUpdate_Submit" runat="server">
                    <ContentTemplate>
                        <asp:Label ID="lblErrorMsg" runat="server" Text="" ForeColor="red"></asp:Label>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnSearch" /> 
                    </Triggers>
                </asp:UpdatePanel>
                
                 
            </td>
        </tr> 
</table>

  </asp:Panel>
     

</asp:Content>